import 'package:flutter/material.dart';

///Text demo
class TextDemo extends StatelessWidget {
  final String title;

  const TextDemo({Key? key, required this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text(
          "$title",
          style: TextStyle(color: Colors.red, fontSize: 20),
        ),
      ),
      body: TextWidget(),
    );
  }
}

class TextWidget extends StatelessWidget {
  const TextWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text(
          "文本" * 20,
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
        ),
        Container(
          //dev
          width: double.infinity,
          color: Colors.blue,
          child: Text(
            "从哪里开始排序",
            maxLines: 1,
            overflow: TextOverflow.visible,
            textDirection: TextDirection.rtl,
            //从右到左
            textAlign: TextAlign.center,
            style: TextStyle(
              color: Colors.white,
              fontSize: 24,
            ),
          ),
        ),
      ],
    );
  }
}
